<?php 

	$this->headScript()->appendFile( $this->baseUrl() . '/public/js/swfupload/swfupload.js' );
	$this->headScript()->appendFile( $this->baseUrl() . '/public/js/swfupload/swfupload.queue.js' );
	$this->headScript()->appendFile( $this->baseUrl() . '/public/js/swfupload/fileprogress.js' );
	$this->headScript()->appendFile( $this->baseUrl() . '/public/js/swfupload/handlers.js?v=120810' );
	
	$this->placeholder = isSet( $this->placeholder ) ? $this->placeholder :  'spanButtonPlaceholder1';
	$this->progres = isSet( $this->progres ) ? $this->progres :  'fsUploadProgress1';
	$this->cancel = isSet( $this->cancel ) ? $this->cancel :  'btnCancel1';

	echo $this->inlineScript()->setScript( '
		var upload1;
		$(document).ready(function(){
			upload1 = new SWFUpload({
				// Backend Settings
				upload_url: "' . $this->baseUrl() . '/uploader/upload/?u=' . md5( time() ) . '",
				post_params: {"PHPSESSID" : "' . session_id() . '"},

				// File Upload Settings
				file_size_limit : "102400",	// 100MB
				file_types : ' . $this->fileTypes . ',
				file_types_description : "' . $this->fileTypesDescription . '",
				file_upload_limit : "100",
				file_queue_limit : "100",

				// Event Handler Settings (all my handlers are in the Handler.js file)
				file_dialog_start_handler : fileDialogStart,
				file_queued_handler : fileQueued,
				file_queue_error_handler : fileQueueError,
				file_dialog_complete_handler : fileDialogComplete,
				upload_start_handler : uploadStart,
				upload_progress_handler : uploadProgress,
				upload_error_handler : uploadError,
				upload_success_handler : ' . $this->uploadSuccess . ',
				upload_complete_handler : uploadComplete,

				// Button Settings
				button_image_url : "' . $this->baseUrl() . '/public/images/XPButtonUploadText_61x22.png",
				button_placeholder_id : "' . $this->placeholder . '",
				button_width: 61,
				button_height: 22,
				
				// Flash Settings
				flash_url : "' . $this->baseUrl() . '/public/js/swfupload/swfupload.swf",
				

				custom_settings : {
					progressTarget : "' . $this->progres . '",
					cancelButtonId : "' . $this->cancel . '"
				},
				
				// Debug Settings
				debug: false
			});
		});
	' );


?>